home *** CD-ROM | disk | FTP | other *** search
- -- Main Movie Scripts
- --
- -- For basic QTVR use this castmember includes most of the scripts you need
- -- Not included are the calls to the "openQTVRMovie" handler and
- -- a frame script to display the movie and allow the user to interact with
- -- it (see "Movie Display Frame Script").
- --------------------------------------------------------------------------
-
- --=============================================================
- -- StartMovie
- --
- -- Sets up things for QTVR. You only want to do this once,
- -- so if you've got multiple Director movies in your project
- -- put these calls in some kind of initialization handler.
- ---------------------------------------------------------------
- on StartMovie
- global gQTVRObj
-
- -- register the Quicktime VR component
- QTVREnter(xtra "QTVRXtra")
-
- -- create a new instance of the xtra
- set gQTVRObj = new(xtra "QTVRXtra")
- end
-
- --=============================================================
- -- StopMovie
- --
- -- This is important: be sure to close your movies when you stop.
- -- Otherwise they hang out taking up ram, even though you don't see them.
- -- This can be a real problem when in authoring mode, as you start and stop
- -- the movie over and over. When in doubt call QTVRClose from the message window.
- ---------------------------------------------------------------
- on StopMovie
- global gQTVRObj
-
- -- Close any open QTVR movies
- QTVRClose(gQTVRObj)
-
- -- unregister the Quicktime VR component
- QTVRExit(xtra "QTVRXtra")
- end
-
- --=============================================================
- -- openQTVRMovie
- --
- -- Opens a pano or object movie.
- -- pMovieName is a full pathname to the movie (paltform-specific)
- -- pSprite is a sprite placholder with the size and location you want
- -- for your qtvr movie.
- --
- -- Note: This handler has no error checking. For an example handler with
- -- error checking, see the openMovie handler in the Testbed.
- ---------------------------------------------------------------
- on openQTVRMovie pMovieName, pSprite
- global gQTVRObj
-
- -- Close any open QTVR movies
- QTVRClose(gQTVRObj)
-
- -- rectToStr is a handler below
- set tRect = rectToStr(the rect of sprite pSprite)
-
- put QTVROpen(gQTVRObj, pMovieName, tRect, "visible")
- end
-
-
- --=============================================================
- -- utilities
- --
- -- these handlers convert Lingo's rect and point variable types
- -- to strings for use by the xtra
- ---------------------------------------------------------------
- on rectToStr myRect
- set myString = string(myRect)
- delete char 1 to 5 of myString
- delete char (the length of myString) of myString
- return myString
- end
-
- on pointToStr myPoint
- set myString = string(myPoint)
- delete char 1 to 6 of myString
- delete char (the length of myString) of myString
- return myString
- end